package com.xbongbong.workflow.pojo.nodes;

import com.xbongbong.paas.domain.entity.ext.FieldPermissionEntityExt;
import com.xbongbong.paas.domain.entity.ext.OptionalRangeEntity;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Map;

/**
 * @author chenpeng
 * @version 1.0
 * @date 2021-05-10 15:07
 * @description 抄送节点
 */
@Getter
@Setter
public class CcNode {
    
    /**
     * 节点抄送人
     */
    @Valid
    @NotEmpty(message = "{dto.msg.ccNode.ccUser.NotEmpty}")
    private List<OptionalRangeEntity> ccUserList;
    
    /**
     * 可见，可编辑，简报，用于每个节点的任务展示
     */
    @Valid
    private Map<String, FieldPermissionEntityExt> fieldPermission;

    /**
     * 标题
     */
    @NotEmpty(message = "{dto.msg.ApprovalNode.title.NotEmpty}")
    private List<WorkflowTitlePojo> title;

    public CcNode() {
    }

    public CcNode(@Valid @NotEmpty(message = "{dto.msg.ccNode.ccUser.NotEmpty}") List<OptionalRangeEntity> ccUserList, @Valid Map<String, FieldPermissionEntityExt> fieldPermission, @NotEmpty(message = "{dto.msg.ApprovalNode.title.NotEmpty}") List<WorkflowTitlePojo> title) {
        this.ccUserList = ccUserList;
        this.fieldPermission = fieldPermission;
        this.title = title;
    }
}
